<style>
  .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
</style>

<body>
<div class="layuimini-container">
  <div class="layuimini-main">

    <div class="layui-form layuimini-form">

      <input type="hidden" value="{$model->id}" name="id">



      <div class="layui-form-item">
        <label class="layui-form-label required">登陆账号</label>
        <div class="layui-input-block">
          <input type="text" autocomplete="off" class="layui-input" readonly  value="{$model->username}">
        </div>
      </div>

      <div class="layui-form-item">
        <label class="layui-form-label required">登陆密码</label>
        <div class="layui-input-block">
          <input autocomplete="off" type="password" name="password" lay-verify="required" lay-reqtext="密码不能为空" placeholder="请输入新的密码"  value="" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label required">确认密码</label>
        <div class="layui-input-block">
          <input autocomplete="off" type="password" name="again_password" lay-verify="required|confirm_password" lay-reqtext="新的密码不能为空" placeholder="请输入新的密码"  value="" class="layui-input">
        </div>
      </div>

      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
  layui.use(['form','miniTab','jquery'], function () {
    var form = layui.form,
            layer = layui.layer,
            miniTab = layui.miniTab;
    var $ = layui.jquery;
    form.verify({
      confirm_password:function(value){
        if($('input[name=password]').val() !== value)
          return '两次密码输入不一致！';
      }
    });
    //监听提交
    form.on('submit(saveBtn)', function (data) {
      var post_data = data.field;
      postData("{:url('admin/password')}", post_data, '密码设置成功');
      return false;
    });

  });
</script>
</body>
</html>